
#ifndef  _RADIX_ARCHAISM_FILE_H_
#define  _RADIX_ARCHAISM_FILE_H_

#include <Archaism/Header.h>

_BeginNamespace(Radix)

/*
FileOpenMode
r	: readonly nocreate
w	: writeonly
a	: append
r+	: read write nocreate
w+	: read write
a+	: read append
rb, wb, ab, rb+, wb+, ab+   binary
*/
/*
=================================================================
== File
=================================================================
*/
class File
{
public:
	File(const String& fileName, const String& openMode);
	virtual ~File();

public:
	bool open();
	void close();
	bool isOpen();
	bool readable();
	bool writable();
	uint read(void* bytes, uint length);
	uint write(void* bytes, uint length);
	bool seek(int offset, int origin = SEEK_CUR);
	bool eos();
	void flush();

private:
	String mName;
	String mMode;
	FILE* mHandle;
};

_EndNamespace(Radix)

#endif//_RADIX_ARCHAISM_FILE_H_
